package com.vodlee.flowlayoutlib;

import android.content.res.Resources;
import android.util.TypedValue;

public class FlowLayoutManager {

    private static final int DEFAULT_SPEC = dp2px(4);

    private int horizentalDivider;
    private int verticalDivider;

    public int getHorizentalDivider() {
        return horizentalDivider;
    }

    public void setHorizentalDivider(int horizentalDivider) {
        this.horizentalDivider = horizentalDivider;
    }

    public int getVerticalDivider() {
        return verticalDivider;
    }

    public void setVerticalDivider(int verticalDivider) {
        this.verticalDivider = verticalDivider;
    }

    public static FlowLayoutManager getDefaultManager() {
        FlowLayoutManager manager = new FlowLayoutManager();
        manager.horizentalDivider = DEFAULT_SPEC;
        manager.verticalDivider = DEFAULT_SPEC;
        return manager;
    }

    public static int dp2px(int dp) {
        return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, Resources.getSystem().getDisplayMetrics());
    }
}
